/* 
7.循环数组，从数组对象里找到所有符合条件的对象组成新数组，可以有多条，找不到则返回空数组[]
*/
let arr = [
    { name: "张三", age: 13, isActive: false, class: '五年级', sex: 'girl' },
    { name: "李四", age: 13, isActive: true, class: '六年级', sex: 'boy' },
];
let age = 13;
let newArr = arr.filter(v => v.age === age)
console.log(newArr);
//console
// [
//     { name: '张三', age: 13, isActive: false, class: '五年级', sex: 'girl' },
//     { name: '李四', age: 13, isActive: true, class: '六年级', sex: 'boy' }
//   ]
age=14;
newArr = arr.filter(v => v.age === age)
console.log(newArr);
//console
// []